/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.cezary.butler.walili.common.config;

import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Cezary Butler
 */
public class LoggerConfigurator {
    private final Logger log;

    public LoggerConfigurator(String name) {
        this(Logger.getLogger(name));
    }
    
    public LoggerConfigurator(Logger l){
        log=l;
    }
    
    public Logger getLogger(){
        return log;
    }    
    
    public void setLevel(Level arg0){
        log.setLevel(arg0);
    }
    
    public void setLevel(String lvl){
        setLevel(Level.parse(lvl.toUpperCase()));
    }
    
    public void setParent(Logger l){
        log.setParent(l);
    }
    
    public void setParent(LoggerConfigurator lc){
        setParent(lc.getLogger());
    }
    
    public void addHandler(Handler arg0){
        log.addHandler(arg0);
    }

}
